<?php 
class CN_Database extends CN_Model{
    
    var $table_name = NULL;
   
    
    function __construct($my_table=false){
        parent::__construct(); 
        if($my_table)
            $this->table_name = $my_table;
    }
    
    
    //TODO IMPLEMENT PREFIX SUPORT
    function load($id=false){
        if($id)
            $this->db->where("id",$id);
        $this->db->from($this->table_name);
        
        $this->get_result();
        
        
        $className = get_called_class();
        $trace = debug_backtrace();
        $trace[0]['object']->nome="tonho";
        // echo "<pre>";
        // print_r($trace);die();
        // Call callback method
    }
    
    //TODO if table not found, create it!
    function get_result(){
        return $this->db->get()->result();
    }
}
?>